package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.BdmGoodclassify;
import com.ruoyi.system.mapper.BdmGoodclassifyMapper;
import com.ruoyi.system.service.IBdmGoodclassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-13
 */
@Service
public class BdmGoodclassifyServiceImpl extends ServiceImpl<BdmGoodclassifyMapper,BdmGoodclassify> implements IBdmGoodclassifyService
{
    @Autowired
    private BdmGoodclassifyMapper bdmGoodclassifyMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public BdmGoodclassify selectBdmGoodclassifyById(Long id)
    {
        return bdmGoodclassifyMapper.selectBdmGoodclassifyById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param bdmGoodclassify 商品分类
     * @return 商品分类
     */
    @Override
    public List<BdmGoodclassify> selectBdmGoodclassifyList(BdmGoodclassify bdmGoodclassify)
    {
        return bdmGoodclassifyMapper.selectBdmGoodclassifyList(bdmGoodclassify);
    }

    /**
     * 新增商品分类
     * 
     * @param bdmGoodclassify 商品分类
     * @return 结果
     */
    @Override
    public int insertBdmGoodclassify(BdmGoodclassify bdmGoodclassify)
    {
        bdmGoodclassify.setCreateTime(DateUtils.getNowDate());
        return bdmGoodclassifyMapper.insertBdmGoodclassify(bdmGoodclassify);
    }

    /**
     * 修改商品分类
     * 
     * @param bdmGoodclassify 商品分类
     * @return 结果
     */
    @Override
    public int updateBdmGoodclassify(BdmGoodclassify bdmGoodclassify)
    {
        bdmGoodclassify.setUpdateTime(DateUtils.getNowDate());
        return bdmGoodclassifyMapper.updateBdmGoodclassify(bdmGoodclassify);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBdmGoodclassifyByIds(Long[] ids)
    {
        return bdmGoodclassifyMapper.deleteBdmGoodclassifyByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBdmGoodclassifyById(Long id)
    {
        return bdmGoodclassifyMapper.deleteBdmGoodclassifyById(id);
    }
}
